#include "T_MainScn.h"
#include "T_App.h"

T_MainScn::T_MainScn()
{
}

T_MainScn::~T_MainScn()
{
}

bool T_MainScn::OnInit(GAF_CBundle* pParam)
{
	m_pimgBack = GAF_CImage::Create("./res/MainBack.bmp");
	AddGraphics(m_pimgBack);

#ifdef TEST_RenderText
	m_scnTenderText.Init();
#endif

#ifdef TEST_Face
	m_scnFace.Init();
#endif

#ifdef TEST_Layout
	m_scnLayout.Init();
#endif

#ifdef TEST_ControlAction
        m_scnControlAction.Init();
#endif

#ifdef TEST_AttribAssociate
	m_scnAttribAssociate.Init();
#endif

#ifdef TEST_Maps
	m_scnMaps.Init();
#endif
	return true;
}

void T_MainScn::OnKeyUp(ULONG lCode)
{
	switch(lCode)
	{
	case GAF_KEY_ESCAPE:
		ReturnOK();
		break;

#ifdef TEST_Face
	case GAF_KEY_F:
		m_scnFace.Call();
		break;
#endif

#ifdef TEST_Layout
	case GAF_KEY_L:
		m_scnLayout.Call();
		break;
#endif

#ifdef TEST_SceneShowCall
	case GAF_KEY_2:
		GAF_pTHEMYAPP->GetSecondScene()->Show();
		break;
	case GAF_KEY_3:
		GAF_pTHEMYAPP->GetSubScene()->Call();
		break;
#endif

#ifdef TEST_RenderText
	case GAF_KEY_T:
		m_scnTenderText.Call();
		break;
#endif

#ifdef TEST_ControlAction
	case GAF_KEY_C:
		m_scnControlAction.Call();
		break;
#endif

#ifdef TEST_AttribAssociate
	case GAF_KEY_A:
		m_scnAttribAssociate.Call();
		break;
#endif

#ifdef TEST_Maps
	case GAF_KEY_M:
		m_scnMaps.Call();
		break;
#endif
	}
}
